Open
Conversation
This script captures the desktop screen and streams it using MPV.
This script sets up the environment for running the cdmpv application under systemd, ensuring necessary variables are defined and logging is handled.
Cleaned and optimized mpv configuration for Vulkan and shader upscaling workflow, preserving original behavior while consolidating settings.
Added stabilization notes and troubleshooting steps for the cdmpv pipeline, including root cause analysis, changes made, and instructions for starting, stopping, and inspecting the service.
Mark PKGBUILD as deprecated for CosmiciIndustries C05M1C.
Mark the script as deprecated and update shebang.
32 bit? depricated
no overlapping screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
a wrapper to view upscaled primary monitor natively insted of tigervnc it runs its own wrapper service to get around some errors;
cdmpv — Stabilized pipeline & troubleshooting notes (2025-12-26)
Summary
Stabilized
cdmpvlive-desktop capture →mpvpipeline. Root cause analysis, fix applied and operational commands have been recorded here so the environment can be reproduced or rolled back.Work completed:
mpvprofile (qrawvideo) that caused immediatempvexit and subsequentffmpegbroken-pipe failures.live-desktop-mpv.shwith a simplified, robust pipeline wrapper that uses only validatedffmpegandmpvflags and writes a small persistent run log.systemd(unit:~/.config/systemd/user/cdmpv-live.service) and confirmedmpvwindow appears with near real-time latency (~1s).Root causes (concise)
mpvwas passed--profile=qrawvideowhich does not exist on target system —mpvimmediately exited.ffmpegproduced frames whilempvwas gone; pipe broke andffmpegfailed with "Broken pipe" and "Conversion failed!".Files changed (updated) — locations
~/cdmpv/live-desktop-mpv.sh— replaced with a simplified robust pipeline (this file contains the runnable pipeline and logging).Other relevant files (unchanged but important):
~/cdmpv/run-cdmpv-wrapper.sh— wrapper used by the systemd unit. Keep executable.~/.config/systemd/user/cdmpv-live.service— user unit that launches the wrapper.~/.local/state/cdmpv/live-desktop-mpv.logHow to start / stop / inspect
Start (user unit):
systemctl --user daemon-reload systemctl --user enable --now cdmpv-live.serviceStop:
Reset failed state (if systemd refuses to start after crashes):
Inspect logs:
Quick reproducible pipeline (manual test)
Run this to test single-monitor capture and verify offsets without the systemd unit:
If that produces the expected single-monitor view in
mpv, you can map those values intolive-desktop-mpv.shby setting theHOST_DISPLAYandCAPTURE_OFFSET(or by editing the script to pass a:0+X,Ycapture target).Known issue: infinite mirror (mirroring both screens)
Cause: current pipeline captures the entire X root (
:0) which on a multi-monitor X server is the combined desktop (all monitors arranged side-by-side). Whenmpvdisplays the upscaled result on the same X server, if the capture region includes the output window, you get a recursive mirror.Mitigations (ordered):
Capture a single monitor (recommended). Use
-video_size WxH -i :0+X,YwhereX,Yare the top-left pixel of the target monitor. Usexrandr --listmonitorsto obtain per-monitor geometry and offsets.Create a small X screen / nested X server for capture. Use an Xvfb/Xvnc nested instance dedicated solely to the guest environment you upscale; do not render the
mpvwindow into that same X screen.Move
mpvoutput to a different display / fullscreen overlay. Runmpvon a separate display (e.g. another virtual display or use Wayland XWayland trickery) soffmpegcapturing:0will not include thempvwindow.Filter the capture area by window id. Use
ffmpeg's-i x11grabwith a window ID (if stable) or extract the window geometry and capture only that box — but this is fragile ifmpvmoves.Immediate recommended fix (practical):
~/cdmpv/live-desktop-mpv.shand setCAPTURE_TARGET=':0+X,Y'andVIDEO_SIZE='WxH'for the monitor you want to capture. Example values for a primary 1920×1080 monitor at X offset 0:VIDEO_SIZE=1920x1080 CAPTURE_TARGET=':0+0,0'config.sh.How to revert to previous script (git / backup)
If you had the prior copy in Git, use
git checkout -- ~/cdmpv/live-desktop-mpv.sh.If not, keep a backup before editing in future:
Diagnostics snippets collected during the run (high-value lines)
mpvreturned:Unknown profile 'qrawvideo'→ fixed by removing profile.ffmpegerrors that followed wereError muxing a packet/Error writing trailer: Broken pipe— these were secondary tompvexit.~/.local/state/cdmpv/live-desktop-mpv.log(first lines contain detection output and pipeline command line).